#!/usr/bin/python
# -*- coding: iso-8859-2 -*-
from inc_classes import *
from inc_funs import *
igek = wordlist()
fonev = wordlist()
mellekn = wordlist()
novel = ''

i = open('igek2.txt', 'r')
line = i.read()
lineList = line.split()
for w in lineList:
        w=word(hangrend(w),w)
        igek.append(w) 
i.close

f = open('fonevek2.txt', 'r')
line = f.read()
lineList = line.split()
for w in lineList:
        w=word(hangrend(w),w)
        fonev.append(w) 
f.close

m = open('melleknevek2.txt', 'r')
line = m.read()
lineList = line.split()
for w in lineList:
        w=word(hangrend(w),w)
        mellekn.append(w) 
m.close

lenigek=len(igek)
lenfonev=len(fonev)
lenmellek=len(mellekn)

def szorepl(arg,ranz):
    arg = arg.replace('%mnevn',mellekn[ranz[0]].n())
    arg = arg.replace('%mnev',mellekn[ranz[0]].s())
    arg = arg.replace('%fonev',fonev[ranz[1]].s())
    arg = arg.replace('%ige',igek[ranz[2]].s())
    arg = arg.replace('%igni',igek[ranz[2]].ni())
    arg = arg.replace('%fnevt',fonev[ranz[0]].t())
    arg = arg.replace('%fnevv',fonev[ranz[4]].v())
    arg = arg.replace('%fneva',fonev[ranz[0]].a())
    arg = arg.replace('%fnevs',fonev[ranz[0]].ss())
    return arg
